//
//  GroupPeopleInfoController.m
//  SouthChina
//
//  Created by creator_lq on 15/1/8.
//  Copyright (c) 2015年 科创. All rights reserved.
//

#import "GroupPeopleInfoController.h"
#import "AddressBookViewController.h"
#import "AddressBookTableViewCell.h"
#import "ContactDao.h"

@interface GroupPeopleInfoController ()<UITableViewDataSource,UITableViewDelegate>
{
    NSArray *orgContactList;
    NSString * title;
    Contact *curOrgContact;
    
    
}
@property (strong, nonatomic) UISearchBar * searchBar;

@end

@implementation GroupPeopleInfoController

@synthesize orgId;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    
    return self;
}
 

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:YES];
    
    
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    curOrgContact =[ContactDao getContactById:orgId];
    
    orgContactList = [ContactDao getLeftNodeContact:curOrgContact.mID];
    
    
    [self addTitleBarWithBackBtn:@"群组成员" needReturn:YES];
    
    //联系人列表
    _addressTableview.tableHeaderView.backgroundColor = [UIColor whiteColor];
    int tableHeinght= (SCREEN_HEIGHT-TITLE_BAR_HEGIHT-64);
    _addressTableview = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, SCREEN_WIDTH, tableHeinght) style:UITableViewStylePlain];
    _addressTableview.delegate = self;
    _addressTableview.dataSource = self;
    _addressTableview.bounces=NO;
    _addressTableview.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:_addressTableview];

    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    orgContactList = [ContactDao searcherNodeContact:curOrgContact.mID key:@""];
    return orgContactList.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    /*
    static NSString * identifier = @"AddressBookTableViewCell";
    AddressBookTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:identifier];
    if (!cell) {
        cell=[[AddressBookTableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier];
    }
    Contact *contact =[orgContactList objectAtIndex:indexPath.row];
    [cell setContactValue:contact isCreat:NO ];
    
    return cell;
     */
    return nil;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return CONTACT_HEIGHT;
    
}


@end
